import {get,postJSON,upload} from "@/utils/http/createHttp.js"

const apiArticle  = {
    // 获取所有文章
    getAllArticle:()=>{
        return get("/api/user/getAllArticle")
    },
    // 添加文章
    addArticle:(data)=>{
        return postJSON("/article/add",data)
    },
    // 上传文件
    UploadFile:(data)=>{
        return upload("/upload/file",data)
    },
    // 获取美食名以及ID
    getGoodsNameAndId:()=>{
        return get("/article/getGoodsNameAndId")
    },
    // 更新 
    UpdateArticle:(data)=>{
        return postJSON("/article/update",data)
    },
    // 获取美食
    getAllGoods:()=>{
        return get("/api/user/getAllGoods")
    },
    // 删除
    deleteArticle:(data)=>{
        return postJSON("/article/delete",data)
    }
}

export default apiArticle